# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=indicator-china-weather
pkgver=3.0.4
pkgrel=1
pkgdesc="Indicator that displays China weather information"
arch=('loong64' 'x86_64')
license=('GPL')
url="https://github.com/UbuntuKylin/indicator-china-weather"
groups=('ukui')
depends=('geoip' 'qt5-base')
makedepends=('qt5-tools')
source=("https://github.com/UbuntuKylin/indicator-china-weather/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('79f3944591e6d1988b745e9567d9a3ef023a53d435b5164376d7295c4419edc75fb62a8c970552ea34fe66d1b13ff263d5948e9a6f418a6d3a596a88f85c4501')

prepare() {
  cd indicator-china-weather-$pkgver
  sed -i '/#include <QPainter>/a #include <QPainterPath>' src/{tooltip,cityitemwidget,texttip}.cpp
  sed -i '/dpkg-buildflags/d' indicator-china-weather.pro
}

build() {
  cd indicator-china-weather-$pkgver
  qmake-qt5 PREFIX=/usr
  make
}

package() {
  cd indicator-china-weather-$pkgver
  make INSTALL_ROOT="$pkgdir" install
}
